package com.ruoyi.web.controller.combat.apprisk;

import com.ruoyi.combat.service.apprisk.CombatApplicationDataService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/combat/applicationData")
@Api(tags = "课题一：应用服务检测-数据统计接口")
public class CombatApplicationDataController extends BaseController {

    @Autowired
    private CombatApplicationDataService combatApplicationDataService;

    @GetMapping("/getNum")
    @ApiOperation("终端、APK、风险、APP新增、终端新增统计")
    public AjaxResult getNum(){
        return AjaxResult.success(combatApplicationDataService.getNum());
    }

    @GetMapping("/getAddNumByDay")
    @ApiOperation("每日监测库增量")
    public AjaxResult getAddNumByDay(){
        return AjaxResult.success(combatApplicationDataService.getAddNumByDay());
    }

    @GetMapping("/appRiskCount")
    @ApiOperation("各类风险占比")
    public AjaxResult appRiskCount(){
        return AjaxResult.success(combatApplicationDataService.appRiskCount());
    }

    @GetMapping("/apkRiskRank")
    @ApiOperation("APK风险排行榜")
    public AjaxResult apkRiskRank(){
        return AjaxResult.success(combatApplicationDataService.appRiskCount());
    }

    @GetMapping("/terminalRiskRank")
    @ApiOperation("终端风险排行榜")
    public AjaxResult terminalRiskRank(){
        return AjaxResult.success(combatApplicationDataService.terminalRiskRank());
    }

}
